redirect to the same page django

55

redirect to the same page django -

from django.http import HttpResponseRedirect


return HttpResponseRedirect(request.path_info)

how to redirect to previous page in django -

<form method="POST">
    {% csrf_token %}
    {{ form }}
    <input type="hidden" name="next" value="{{ request.path }}">
    <button type="submit">Let's Go</button>
</form>

Comments

Submit
0 Comments